<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="__INDEX__/css/mui.min.css" rel="stylesheet" />
		<link href="__INDEX__/css/Phoebe.css" rel="stylesheet" />
		<link href="__INDEX__/css/all.css" rel="stylesheet" />
		<link href="__INDEX__/css/sub-inquire.css" rel="stylesheet" />
		<title>我的出售</title>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a href="javascript:history.back(-1)" class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">我的出售</h1>
		</header>
		<ul class="sub-inquire">
			<li>
				<a href="javascript:void(0)">
					<ul>
						<li style="width:25%">产品</li>
						<li style="width:25%">出售日期</li>
						<li style="width:13%">数量</li>
						<li style="width:13%">单价</li>
						<li style="width:12%">状态</li>
						<li style="width:12%">操作</li>
					</ul>
				</a>
			</li>
			<li>
				{foreach name="list" item="o"}
				<a href="javascript:void(0)">
					<ul>
						<li style="width:25%">{$o.name}</li>
						<li style="width:25%">{$o.add_time|substr=0,10}</li>
						<li style="width:13%">{$o.num}</li>
						<li style="width:13%">{$o.price}</li>
						<li style="width:12%">
							{if $o.status==1}
							挂起
							{elseif $o.status==2}
							完成
							{else/}
							撤单
							{/if}</li>
						<li style="width:12%">
							{if $o.status==1}
							<button type="button" onclick="chedan(this,'{$o.id}')" class="mui-btn mui-btn-link">
							撤单</button>
							{/if}
							
						</li>
					</ul>
				</a>
				{/foreach}
			</li>
		</ul>
			<script src="js/mui.min.js"></script>
		<script src="/public/static/js/jquery.min.js"></script>
		<script src="/public/static/layui/layui.all.js"></script>
		<script>
			function chedan(obj,order_id){
				var con = layer.confirm('您确定撤销该笔订单?', function(index) {
					$.ajax({
	                    url: "{:url('index/chedan')}",
	                    data:{
	                    	order_id:order_id
	                    },
	                    success:function ( data ) {
	                    	layer.msg(data.msg);
	                    	if(data.code==200){
	                    		$(obj).parent().parent().remove();
	                    	}
	                    }
               		 })
				});
			}
		</script>
		
	</body>

</html>